<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>class属性绑定2</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <!--text-danger 类背景颜色覆盖了 active 类的背景色：-->
    <style>
        .srcClass{
            background-image: url("../../images/timg2.jpg");
            background-size: 100%;
            background-repeat: no-repeat;
            height: 500px;
        }
        .srcClass2{
            background-image: url("../../images/timg3.png");
            height: 500px;
        }
    </style>
</head>
<body>
<div id="case6-demo">
    <div v-bind:class="{srcClass:srcFlag,'srcClass2':srcFlag2}" v-on:click="srcChange"></div>
</div>
<script type="text/javascript">
    var case6Demo=new Vue({
        el:"#case6-demo",
        data:{
            srcFlag:true,
            srcFlag2:true
        },
        methods:{
            srcChange:function () {
                this.srcFlag2=!this.srcFlag2
            }
        }
    })
</script>
</body>
</html>